﻿using System.Windows.Media.Media3D;

namespace Wen.UI.NavigationElements
{
    internal class SpotLightPositionViewModel : XyzControlViewModelBase
    {
        private readonly Point3D _stockPosition;
        private readonly SpotLight _spotLight;

        internal SpotLightPositionViewModel(SpotLight spotLight) {
            _stockPosition = spotLight.Position;
            _spotLight = spotLight;
        }

        protected override void ApplyXMovement(double step) {
            _spotLight.Position = new Point3D(_spotLight.Position.X + step, _spotLight.Position.Y, _spotLight.Position.Z);
        }

        protected override void ApplyYMovement(double step) {
            _spotLight.Position = new Point3D(_spotLight.Position.X, _spotLight.Position.Y + step, _spotLight.Position.Z);
        }

        protected override void ApplyZMovement(double step) {
            _spotLight.Position = new Point3D(_spotLight.Position.X, _spotLight.Position.Y, _spotLight.Position.Z + step);
        }

        protected override void Reset() {
            _spotLight.Position = _stockPosition;
        }

    	protected override Point3D RawCoords
    	{
			get { return _spotLight.Position; }
    	}
    }
}
